package cn.lin.service.impl;

import cn.lin.config.RabbitMQConfig;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * MQ 消息发送者
 * @author cn.Lin
 * @create 2024-12-04-11:52
 */
@Service
public class MessageSender {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    /**
     * 发送签到消息
     * @param stuId 对应签到的学生id
     */
    public void sendSignInMessage(Integer stuId) {
        rabbitTemplate.convertAndSend(RabbitMQConfig.SIGN_IN_QUEUE, stuId);
    }

}
